﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="fee-payment.aspx.cs" Inherits="student_fee_payment" Title="Student Fee Payment"
    MaintainScrollPositionOnPostback="true" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxToolKit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>Student Fee Payment</title>

    <script src="../include/js/form.js" type="text/javascript"></script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="bodyContentTop" runat="Server">
    <h1>
        Student Fee Payment</h1>
    <h3>
        Payment transaction for student fee.</h3>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="bodyContent" runat="Server">
    <div class="elements_inner_wrapper">
        <div id="contentBody">
            <div class="section">
                <div class="seperator">
                </div>
                <fieldset class="formouter">
                    <table cellpadding="3" cellspacing="3" width="100%">
                        <tr>
                            <td>
                                <asp:HyperLink runat="server" ID="hplStudentList" Text="View Listing" NavigateUrl="~/student/student-list.aspx"></asp:HyperLink>
                                &nbsp;&nbsp;<asp:HyperLink runat="server" ID="hplStudent" Text="Edit Details" NavigateUrl="~/student/default.aspx"></asp:HyperLink>
                                &nbsp;&nbsp;&nbsp;&nbsp;<asp:Label runat="server" ID="lblTopMessage" Text="" Font-Bold="true"
                                    Font-Size="Large" ForeColor="Red"></asp:Label>
                                <div class="row_curved" id="divSchoolList" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlSchoolList.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Selected School Name" ID="Label2" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlSchoolList" OnSelectedIndexChanged="ddlSchoolList_SelectedIndexChanged"
                                                DataSourceID="ObjectDataSource1" DataTextField="ListText" DataValueField="ListValue" />
                                            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="SIS.ENT.Listing"
                                                DeleteMethod="Delete" OldValuesParameterFormatString="original_{0}" SelectMethod="GetList"
                                                TypeName="SIS.BLL.ListingManager" UpdateMethod="Save">
                                                <SelectParameters>
                                                    <asp:Parameter DefaultValue="1" Name="ListType" Type="Int32" />
                                                </SelectParameters>
                                            </asp:ObjectDataSource>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divSchoolMajor" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlSchoolMajor.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Major" ID="Label3" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlSchoolMajor" OnSelectedIndexChanged="ddlSchoolMajor_SelectedIndexChanged"
                                                DataSourceID="odsSchoolMajor" DataTextField="Description" DataValueField="SchoolMajorKey" />
                                            <asp:ObjectDataSource ID="odsSchoolMajor" runat="server" DeleteMethod="Delete" OldValuesParameterFormatString="original_{0}"
                                                SelectMethod="GetList" TypeName="SIS.BLL.SchoolMajorTableManager" DataObjectTypeName="SIS.ENT.SchoolMajorTable"
                                                UpdateMethod="Save">
                                                <DeleteParameters>
                                                    <asp:Parameter Name="SchoolMajorKey" Type="Int32" />
                                                </DeleteParameters>
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="ddlSchoolList" Name="SchoolKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                </SelectParameters>
                                            </asp:ObjectDataSource>
                                            <asp:RequiredFieldValidator ID="rfvSchoolMajor" ValidationGroup="StudentRegister"
                                                ControlToValidate="ddlSchoolList" runat="server" CssClass="validationErrorControl"
                                                Display="Dynamic" ErrorMessage="<br/>Please select a school name.<br/>"></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divStandardLevel" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlStandardLevel.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Standard/Level Name" ID="lblStandardLevel" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlStandardLevel" OnSelectedIndexChanged="ddlStandardLevel_SelectedIndexChanged"
                                                DataSourceID="odsStandarLevel" DataTextField="Description" DataValueField="StandardLevelKey"
                                                Style="height: 22px" />
                                            <asp:ObjectDataSource ID="odsStandarLevel" runat="server" OldValuesParameterFormatString="original_{0}"
                                                SelectMethod="GetList" TypeName="SIS.BLL.StandardLevelTableManager" DataObjectTypeName="SIS.ENT.StandardLevelTable"
                                                DeleteMethod="Delete" UpdateMethod="Save">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="ddlSchoolList" Name="SchoolKey" PropertyName="SelectedValue"
                                                        Type="Int32"></asp:ControlParameter>
                                                    <asp:ControlParameter ControlID="ddlSchoolMajor" Name="SchoolMajorKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                </SelectParameters>
                                            </asp:ObjectDataSource>
                                            <asp:RequiredFieldValidator ID="rfvStandardLevel" ValidationGroup="StudentRegister"
                                                ControlToValidate="ddlStandardLevel" runat="server" CssClass="validationErrorControl"
                                                Display="Dynamic" ErrorMessage="<br/>Please select a standard level.<br/>"></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divLocation" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlLocation.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Location Name" ID="lblLocation" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlLocation" OnSelectedIndexChanged="ddlLocation_SelectedIndexChanged"
                                                DataSourceID="odsLocation" DataTextField="LocationName" DataValueField="LocationKey"
                                                Style="height: 22px" />
                                            <asp:ObjectDataSource ID="odsLocation" runat="server" OldValuesParameterFormatString="original_{0}"
                                                SelectMethod="GetList" TypeName="SIS.BLL.LocationTableManager" DataObjectTypeName="SIS.ENT.LocationTable"
                                                UpdateMethod="Save">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="ddlSchoolList" Name="SchoolKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                </SelectParameters>
                                            </asp:ObjectDataSource>
                                            <asp:RequiredFieldValidator ID="rfvLocation" ValidationGroup="StudentRegister" ControlToValidate="ddlLocation"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage="<br/>Please select a standard level.<br/>"></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div7" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlPeriod.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Period" ID="lblPeriodCaption" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlPeriod" OnSelectedIndexChanged="ddlPeriod_SelectedIndexChanged"
                                                DataSourceID="sqlDSEduPeriod" DataTextField="Description" DataValueField="EducationPeriodKey"
                                                Style="height: 22px" />
                                            <asp:SqlDataSource ID="sqlDSEduPeriod" runat="server" ConnectionString="<%$ ConnectionStrings:sis.dbconn %>"
                                                SelectCommand="sprocEducationPeriodTableSelectList" SelectCommandType="StoredProcedure">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="ddlSchoolList" Name="SchoolKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                    <asp:ControlParameter ControlID="ddlLocation" Name="LocationKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                    <asp:ControlParameter ControlID="ddlStandardLevel" Name="StandardLevelKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                </SelectParameters>
                                            </asp:SqlDataSource>
                                            <asp:RequiredFieldValidator ID="rfvPeriod" ValidationGroup="StudentRegister" ControlToValidate="ddlPeriod"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage="<br/>Please select a period.<br/>"></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div1" runat="server">
                                    <label for="<%=ddlFeeTypeCode.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Fee Type" ID="Label1" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList ID="ddlFeeTypeCode" runat="server" DataSourceID="sqlDSFeeTypeCode"
                                                DataTextField="ShortDescription" DataValueField="FeeTypeCode" AutoPostBack="True"
                                                OnSelectedIndexChanged="ddlFeeTypeCode_SelectedIndexChanged">
                                            </asp:DropDownList>
                                            <asp:SqlDataSource ID="sqlDSFeeTypeCode" runat="server" ConnectionString="<%$ ConnectionStrings:sis.dbconn %>"
                                                SelectCommand="sprocFeeTypeCodeTableSelectList" SelectCommandType="StoredProcedure">
                                            </asp:SqlDataSource>
                                            <asp:RequiredFieldValidator ID="rfvFeeTypeCode" ValidationGroup="StudentFee" ControlToValidate="ddlFeeTypeCode"
                                                InitialValue="-1" runat="server" CssClass="validationErrorControl" Display="Dynamic"
                                                ErrorMessage=""></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                            </td>
                            <td>
                                <div class="row_curved" id="div12" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=lblStudentAccountIDCaption.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Student ID" ID="lblStudentAccountIDCaption" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Label Visible="false" runat="server" Text="-1" ID="lblUserAccountKey" />
                                            <asp:Label Visible="false" runat="server" Text="-1" ID="lblSRID" />
                                            <asp:Label Visible="true" runat="server" Text="-1" ID="lblStudentProfileKey" />
                                            <asp:Label Visible="false" runat="server" Text="0" ID="lblEditRegistration" />
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div13" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=lblFullNameCaption.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Full Name" ID="lblFullNameCaption" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Label runat="server" ID="lblFullName" />
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div14" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=lblContactInfoCaption.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Contact Info" ID="lblContactInfoCaption" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Label runat="server" ID="lblContactInfo" />
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div15" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=lblGuardianFullNameCaption.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Guardian Name" ID="lblGuardianFullNameCaption" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Label runat="server" ID="lblGuardianFullName" />
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div16" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=lblGuardianContactInfoCaption.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Guardian Contact Info" ID="lblGuardianContactInfoCaption" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Label runat="server" ID="lblGuardianContactInfo" />
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divGSRelationShip" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlGSRelation.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Guardian's Relation" ID="lblGSRelation" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList runat="server" ID="ddlGSRelation" />
                                            <asp:RequiredFieldValidator ID="rfvGSRelation" ValidationGroup="GuardianProfile"
                                                ControlToValidate="ddlGSRelation" runat="server" CssClass="validationErrorControl"
                                                Display="Dynamic" ErrorMessage="" InitialValue="-1"></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <h3>
                                    Fee List</h3>
                                <asp:GridView ID="grvStudentFee" runat="server" AutoGenerateColumns="False" DataKeyNames="StudentFeeKey"
                                    DataSourceID="sqlDSStudentFee" EmptyDataText="No transaction found." OnSelectedIndexChanged="grvStudentFee_SelectedIndexChanged"
                                    CellPadding="4" ForeColor="#333333" GridLines="None" Width="100%">
                                    <%--<RowStyle BackColor="#EFF3FB" />
                                    <Columns>
                                        <asp:BoundField DataField="StudentFeeKey" HeaderText="StudentFeeKey" InsertVisible="False"
                                            ReadOnly="True" SortExpression="StudentFeeKey" Visible="false" />
                                        <asp:BoundField DataField="StudentFeeCode" HeaderText="Fee Code" SortExpression="StudentFeeCode" />
                                        <asp:BoundField DataField="EducationPeriodKey" HeaderText="EducationPeriodKey" SortExpression="EducationPeriodKey"
                                            Visible="false" />
                                        <asp:BoundField DataField="FeeTypeCode" HeaderText="FeeTypeCode" SortExpression="FeeTypeCode"
                                            Visible="false" />
                                        <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
                                        <asp:CheckBoxField DataField="Status" HeaderText="Status" SortExpression="Status" />
                                        <asp:BoundField DataField="CreatedDateTime" HeaderText="CreatedDateTime" SortExpression="CreatedDateTime"
                                            Visible="false" />
                                        <asp:BoundField DataField="ModifiedDateTime" HeaderText="Date/Time" SortExpression="ModifiedDateTime" />
                                        <asp:CommandField ShowSelectButton="true" ButtonType="Button" />
                                    </Columns>
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <EditRowStyle BackColor="#2461BF" />
                                    <AlternatingRowStyle BackColor="White" />--%>
                                    <RowStyle BackColor="#EFF3FB" HorizontalAlign="Left" />
                                    <Columns>
                                        <asp:BoundField DataField="StudentFeeKey" HeaderText="StudentFeeKey" InsertVisible="False"
                                            ReadOnly="True" SortExpression="StudentFeeKey" Visible="false" />
                                        <asp:BoundField DataField="StudentFeeCode" ItemStyle-Width="200px" HeaderText="Fee Code"
                                            SortExpression="StudentFeeCode" />
                                        <asp:BoundField DataField="EducationPeriodKey" HeaderText="EducationPeriodKey" SortExpression="EducationPeriodKey"
                                            Visible="false" />
                                        <asp:BoundField DataField="FeeTypeCode" HeaderText="FeeTypeCode" SortExpression="FeeTypeCode"
                                            Visible="false" />
                                        <asp:BoundField DataField="Description" ItemStyle-Width="60%" HeaderText="Description"
                                            SortExpression="Description" />
                                        <asp:CheckBoxField DataField="Status" HeaderText="Status" Visible="false" SortExpression="Status" />
                                        <asp:BoundField DataField="CreatedDateTime" HeaderText="CreatedDateTime" SortExpression="CreatedDateTime"
                                            Visible="false" />
                                        <asp:BoundField DataField="ModifiedDateTime" HeaderText="Date/Time" ItemStyle-Width="180px" SortExpression="ModifiedDateTime" Visible="false"/>
                                        <asp:CommandField ShowSelectButton="true" ButtonType="Button" ItemStyle-Width="100px" />
                                    </Columns>
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
                                    <EditRowStyle BackColor="#2461BF" />
                                    <AlternatingRowStyle BackColor="White" />
                                </asp:GridView>
                                <asp:SqlDataSource ID="sqlDSStudentFee" runat="server" ConnectionString="<%$ ConnectionStrings:sis.dbconn %>"
                                    SelectCommand="sprocStudentFeeTableSelectList" SelectCommandType="StoredProcedure">
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="ddlPeriod" Name="EducationPeriodKey" PropertyName="SelectedValue"
                                            Type="Int32" />
                                        <asp:ControlParameter ControlID="ddlFeeTypeCode" Name="FeeTypeCode" PropertyName="SelectedValue"
                                            Type="Int16" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                                <div style="display: none;">
                                    <asp:TextBox runat="server" ID="txtStudentFeeKey" Text="-1" />
                                    <asp:TextBox runat="server" ID="txtPaymentRefKey" Text="-1" />
                                    <asp:TextBox runat="server" ID="txtSFDKey" Text="-1" />
                                </div>
                                <br />
                                <h3>
                                    Detail List</h3>
                                <asp:GridView ID="grvStudentFeeDetail" runat="server" AutoGenerateColumns="False"
                                    DataKeyNames="SFDKey" DataSourceID="sqlDSStudentFeeDetail" EmptyDataText="No item found."
                                    OnSelectedIndexChanged="grvStudentFeeDetail_SelectedIndexChanged" CellPadding="4"
                                    ForeColor="#333333" GridLines="None" Width="100%">
                                    <%--<RowStyle BackColor="#EFF3FB" />
                                    <Columns>
                                        <asp:BoundField DataField="SFDKey" HeaderText="SFDKey" InsertVisible="False" ReadOnly="True"
                                            SortExpression="SFDKey" Visible="false" />
                                        <asp:BoundField DataField="StudentFeeKey" HeaderText="StudentFeeKey" ReadOnly="True"
                                            SortExpression="StudentFeeKey" Visible="false" />
                                        <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
                                        <asp:BoundField DataField="Amount" HeaderText="Amount" DataFormatString="{0:F2}"
                                            SortExpression="Amount" />
                                        <asp:BoundField DataField="AdditionalAmount" DataFormatString="{0:F2}" HeaderText="AdditionalAmount"
                                            SortExpression="AdditionalAmount" />
                                        <asp:BoundField DataField="OtherAmount" DataFormatString="{0:F2}" HeaderText="OtherAmount"
                                            SortExpression="OtherAmount" />
                                        <asp:BoundField DataField="DueDate" HeaderText="DueDate" SortExpression="DueDate" />
                                        <asp:BoundField DataField="FinalDueDate" HeaderText="FinalDueDate" SortExpression="FinalDueDate" />
                                        <asp:CheckBoxField DataField="Status" HeaderText="Status" SortExpression="Status" />
                                        <asp:BoundField DataField="CreatedDateTime" HeaderText="CreatedDateTime" SortExpression="CreatedDateTime"
                                            Visible="false" />
                                        <asp:BoundField DataField="ModifiedDateTime" HeaderText="Date/Time" SortExpression="ModifiedDateTime" />
                                        <asp:CommandField ShowSelectButton="true" ButtonType="Button" />
                                    </Columns>
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <EditRowStyle BackColor="#2461BF" />
                                    <AlternatingRowStyle BackColor="White" />--%>
                                    <RowStyle BackColor="#EFF3FB" HorizontalAlign="Left" />
                                    <Columns>
                                        <asp:BoundField DataField="SFDKey" HeaderText="SFDKey" InsertVisible="False" ReadOnly="True"
                                            SortExpression="SFDKey" Visible="false" />
                                        <asp:BoundField DataField="StudentFeeKey" HeaderText="StudentFeeKey" ReadOnly="True"
                                            SortExpression="StudentFeeKey" Visible="false" />
                                        <asp:BoundField DataField="Description" ItemStyle-Width="50%" HeaderText="Description"
                                            SortExpression="Description" />
                                        <asp:BoundField DataField="Amount" ItemStyle-Width="100px" HeaderText="Amount" DataFormatString="{0:F2}"
                                            SortExpression="Amount" />
                                        <asp:BoundField DataField="AdditionalAmount" ItemStyle-Width="80px" DataFormatString="{0:F2}"
                                            HeaderText="Additional" SortExpression="AdditionalAmount" />
                                        <asp:BoundField DataField="OtherAmount" ItemStyle-Width="80px" DataFormatString="{0:F2}"
                                            HeaderText="Others" SortExpression="OtherAmount" />
                                        <asp:BoundField DataField="DueDate" HeaderText="DueDate" SortExpression="DueDate"
                                            Visible="False" />
                                        <asp:BoundField DataField="FinalDueDate" HeaderText="FinalDueDate" SortExpression="FinalDueDate"
                                            Visible="False" />
                                        <asp:CheckBoxField DataField="Status" HeaderText="Status" SortExpression="Status"
                                            Visible="False" />
                                        <asp:BoundField DataField="CreatedDateTime" HeaderText="CreatedDateTime" SortExpression="CreatedDateTime"
                                            Visible="false" />
                                        <asp:BoundField DataField="ModifiedDateTime" ItemStyle-Width="180px" HeaderText="Date/Time" SortExpression="ModifiedDateTime" Visible="false" />
                                        <asp:CommandField ShowSelectButton="true" ButtonType="Button" ItemStyle-Width="100px" />
                                    </Columns>
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
                                    <EditRowStyle BackColor="#2461BF" />
                                    <AlternatingRowStyle BackColor="White" />
                                </asp:GridView>
                                <asp:SqlDataSource ID="sqlDSStudentFeeDetail" runat="server" ConnectionString="<%$ ConnectionStrings:sis.dbconn %>"
                                    SelectCommand="sprocStudentFeeDetailSelectList" SelectCommandType="StoredProcedure">
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="txtStudentFeeKey" Name="StudentFeeKey" PropertyName="Text"
                                            Type="Int32" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                                <br />
                                <h3>
                                    Payment Transaction List</h3>
                                <asp:Label runat="server" ID="lblSFPTOutMessage" Font-Bold="true" ForeColor="Red" />
                                <asp:GridView ID="grvSFPT" runat="server" AutoGenerateColumns="False" DataKeyNames="SFPTKey"
                                    DataSourceID="sqlDSStudentFeePaymentTrans" OnSelectedIndexChanged="grvSFPT_SelectedIndexChanged"
                                    CellPadding="4" ForeColor="#333333" GridLines="None" EmptyDataText="No transaction found."
                                    Width="100%">
                                    <RowStyle BackColor="#EFF3FB" HorizontalAlign="Left" />
                                    <Columns>
                                        <asp:BoundField DataField="SFPTKey" HeaderText="SFPTKey" ReadOnly="True" SortExpression="SFPTKey"
                                            Visible="false" />
                                        <asp:BoundField DataField="SFDKey" HeaderText="SFDKey" SortExpression="SFDKey" Visible="false" />
                                        <asp:BoundField DataField="PaymentBy" HeaderText="PaymentBy" SortExpression="PaymentBy"
                                            Visible="false" />
                                        <asp:BoundField DataField="PaymentRefKey" HeaderText="PaymentRefKey" SortExpression="PaymentRefKey"
                                            Visible="false" />
                                        <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" ItemStyle-Width="300px" />
                                        <asp:BoundField DataField="PaymentAccountKey" HeaderText="PaymentAccountKey" SortExpression="PaymentAccountKey"
                                            Visible="false" />
                                        <asp:BoundField DataField="PaymentReceivedKey" HeaderText="PaymentReceivedKey" SortExpression="PaymentReceivedKey"
                                            Visible="false" />
                                        <asp:BoundField DataField="PaymentModeCode" HeaderText="PaymentModeCode" SortExpression="PaymentModeCode"
                                            Visible="false" />
                                        <asp:BoundField DataField="PaymentModeDetail" HeaderText="PaymentModeDetail" SortExpression="PaymentModeDetail"
                                            Visible="false" />
                                        <asp:BoundField DataField="Amount" HeaderText="Amount" ItemStyle-Width="80px" Visible="true"
                                            DataFormatString="{0:F2}" SortExpression="Amount" />
                                        <asp:BoundField DataField="AdditinalAmount" ItemStyle-Width="80px" HeaderText="Additional"
                                            DataFormatString="{0:F2}" SortExpression="AdditinalAmount" />
                                        <asp:BoundField DataField="OtherAmount" ItemStyle-Width="80px" HeaderText="Others"
                                            DataFormatString="{0:F2}" SortExpression="OtherAmount" />
                                        <asp:BoundField DataField="Remark" ItemStyle-Width="30%" HeaderText="Remark" SortExpression="Remark" />
                                        <asp:CheckBoxField DataField="Status" HeaderText="Status" SortExpression="Status"
                                            Visible="false" />
                                        <asp:BoundField DataField="CreatedDateTime" HeaderText="CreatedDateTime" SortExpression="CreatedDateTime"
                                            Visible="false" />
                                        <asp:BoundField DataField="ModifiedDateTime" ItemStyle-Width="140px" HeaderText="Date/Time" SortExpression="ModifiedDateTime" />
                                        <asp:CommandField ShowSelectButton="true" ButtonType="Button" ItemStyle-Width="100px" />
                                    </Columns>
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
                                    <EditRowStyle BackColor="#2461BF" />
                                    <AlternatingRowStyle BackColor="White" />
                                </asp:GridView>
                                <asp:SqlDataSource ID="sqlDSStudentFeePaymentTrans" runat="server" ConnectionString="<%$ ConnectionStrings:sis.dbconn %>"
                                    SelectCommand="sprocStudentFeePaymentTransactionTableSelectList" SelectCommandType="StoredProcedure">
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="txtPaymentRefKey" Name="PaymentRefKey" PropertyName="Text"
                                            Type="Int32" />
                                        <asp:ControlParameter ControlID="txtStudentFeeKey" Name="StudentFeeKey" PropertyName="Text"
                                            Type="Int32" />
                                        <asp:ControlParameter ControlID="txtSFDKey" Name="SFDKey" PropertyName="Text" Type="Int32" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <AjaxToolKit:TabContainer ID="tbcEntry" Enabled="false" runat="server" Visible="true">
                        <AjaxToolKit:TabPanel ID="tbpSFPT" runat="server" HeaderText="Information" CssClass="menuHeader"
                            Visible="true">
                            <HeaderTemplate>
                                <asp:Label ID="Label5" CssClass="menuHeader" runat="server">Fee Details List</asp:Label>
                            </HeaderTemplate>
                            <ContentTemplate>
                                <table cellpadding="3" cellspacing="3" width="100%">
                                    <tr>
                                        <td valign="top">
                                            <div>
                                                <asp:Label runat="server" ID="Label6" Text="" Font-Bold="true" Font-Size="Large"
                                                    ForeColor="Red"></asp:Label>
                                                <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="StudentFeePaymentTrans"
                                                    ShowSummary="True" HeaderText="Please complete all highlighted fields of the form. Thank you."
                                                    CssClass="errorSummary" />
                                                <div style="display: none;">
                                                    <asp:TextBox runat="server" ID="txtPaymentRefKeyValidation" Text="-1" />
                                                    <asp:TextBox runat="server" ID="txtStudentFeeKeyValidation" Text="-1" />
                                                    <asp:TextBox runat="server" ID="txtSFDKeyValidation" Text="-1" />
                                                </div>
                                                <asp:RequiredFieldValidator ID="rfvPaymentRef" ValidationGroup="StudentFeePaymentTrans"
                                                    ControlToValidate="txtPaymentRefKeyValidation" runat="server" CssClass="validationErrorControl"
                                                    InitialValue="-1" Text="No payment ref key found." ErrorMessage="" Display="Dynamic"></asp:RequiredFieldValidator>
                                                <asp:RequiredFieldValidator ID="rfvStudentFeeKey" ValidationGroup="StudentFeePaymentTrans"
                                                    ControlToValidate="txtStudentFeeKeyValidation" runat="server" CssClass="validationErrorControl"
                                                    InitialValue="-1" Text="Please create or select fee firstly." ErrorMessage=""
                                                    Display="Dynamic"></asp:RequiredFieldValidator>
                                                <asp:RequiredFieldValidator ID="rfvSFDKey" ValidationGroup="StudentFeePaymentTrans"
                                                    ControlToValidate="txtSFDKeyValidation" runat="server" CssClass="validationErrorControl"
                                                    InitialValue="-1" Text="Please select a fee detail to settle." ErrorMessage=""
                                                    Display="Dynamic"></asp:RequiredFieldValidator>
                                                <asp:Label runat="server" ID="lblSFPTKey" Text="-1" Visible="false" />
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <h3>
                                                Payment Details</h3>
                                            <div class="row_curved" id="div3" runat="server">
                                                <label for="<%=txtFDDescription.ClientID%>" class="mand_red">
                                                    <asp:Label runat="server" Text="Description" ID="Label8" /></label>
                                                <div class="field">
                                                    <span class="indicator">
                                                        <asp:TextBox ID="txtFDDescription" Width="240px" MaxLength="255" TextMode="MultiLine"
                                                            Rows="4" Columns="40" runat="server" />
                                                        <asp:RequiredFieldValidator ID="rfvFDDescription" ValidationGroup="StudentFeePaymentTrans"
                                                            ControlToValidate="txtFDDescription" runat="server" CssClass="validationErrorControl"
                                                            Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </span>
                                                </div>
                                                <div class="clear">
                                                </div>
                                            </div>
                                            <div class="row_curved" id="div4" runat="server">
                                                <label for="<%=txtFDAmount.ClientID%>" class="mand_red">
                                                    <asp:Label runat="server" Text="Amount" ID="Label9" /></label>
                                                <div class="field">
                                                    <span class="indicator">
                                                        <asp:TextBox ID="txtFDAmount" Width="80px" MaxLength="12" runat="server" />
                                                        OUT AMOUNT:<asp:TextBox ID="txtFDAmountLimit" Width="80px" MaxLength="12" runat="server" />
                                                        <asp:Label runat="server" ID="lblFDAmountLimitMessage" Font-Bold="true" ForeColor="Red" />
                                                        <asp:RequiredFieldValidator ID="rfvFDAmount" ValidationGroup="StudentFeePaymentTrans"
                                                            ControlToValidate="txtFDAmount" runat="server" CssClass="validationErrorControl"
                                                            Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </span>
                                                </div>
                                                <div class="clear">
                                                </div>
                                            </div>
                                            <div class="row_curved" id="div8" runat="server">
                                                <label for="<%=txtFDAddAmount.ClientID%>" class="mand_red">
                                                    <asp:Label runat="server" Text="Addiontal Amount" ID="Label7" /></label>
                                                <div class="field">
                                                    <span class="indicator">
                                                        <asp:TextBox ID="txtFDAddAmount" Width="80px" MaxLength="12" runat="server" />
                                                        OUT AMOUNT:<asp:TextBox ID="txtFDAddAmountLimit" Width="80px" MaxLength="12" runat="server" />
                                                        <asp:Label runat="server" ID="lblFDAddAmountLimitMessage" Font-Bold="true" ForeColor="Red" />
                                                    </span>
                                                </div>
                                                <div class="clear">
                                                </div>
                                            </div>
                                            <div class="row_curved" id="div9" runat="server">
                                                <label for="<%=txtFDOtherAmount.ClientID%>" class="mand_red">
                                                    <asp:Label runat="server" Text="Other Amount" ID="Label11" /></label>
                                                <div class="field">
                                                    <span class="indicator">
                                                        <asp:TextBox ID="txtFDOtherAmount" Width="80px" MaxLength="12" runat="server" />
                                                        OUT AMOUNT:<asp:TextBox ID="txtFDOtherAmountLimit" Width="80px" MaxLength="12" runat="server" />
                                                        <asp:Label runat="server" ID="lblFDOtherAmountLimitMessage" Font-Bold="true" ForeColor="Red" />
                                                    </span>
                                                </div>
                                                <div class="clear">
                                                </div>
                                            </div>
                                            <div class="row_curved" id="div2" runat="server">
                                                <label for="<%=ddlPaymentBy.ClientID%>" class="mand_red">
                                                    <asp:Label runat="server" Text="Payment By" ID="Label4" /></label>
                                                <div class="field">
                                                    <span class="indicator">
                                                        <asp:DropDownList ID="ddlPaymentBy" runat="server">
                                                            <asp:ListItem Text="Select" Value="-1" />
                                                            <asp:ListItem Text="Guardian" Value="1" />
                                                            <asp:ListItem Text="Student" Value="2" />
                                                            <asp:ListItem Text="Others" Value="99" />
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator ID="rfvPaymentBy" ValidationGroup="StudentFeePaymentTrans"
                                                            InitialValue="-1" ControlToValidate="ddlPaymentBy" runat="server" CssClass="validationErrorControl"
                                                            Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </span>
                                                </div>
                                                <div class="clear">
                                                </div>
                                            </div>
                                            <div class="row_curved" id="div10" runat="server">
                                                <label for="<%=ddlPaymentMode.ClientID%>" class="mand_red">
                                                    <asp:Label runat="server" Text="Other Amount" ID="Label10" /></label>
                                                <div class="field">
                                                    <span class="indicator">
                                                        <asp:DropDownList ID="ddlPaymentMode" runat="server">
                                                            <asp:ListItem Text="Select" Value="-1" />
                                                            <asp:ListItem Text="Cash" Value="1" />
                                                            <asp:ListItem Text="Bank Transfer" Value="2" />
                                                            <asp:ListItem Text="Credit Card" Value="3" />
                                                            <asp:ListItem Text="NETS" Value="4" />
                                                            <asp:ListItem Text="Others" Value="99" />
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator ID="rfvPaymentMode" ValidationGroup="StudentFeePaymentTrans"
                                                            InitialValue="-1" ControlToValidate="ddlPaymentMode" runat="server" CssClass="validationErrorControl"
                                                            Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </span>
                                                </div>
                                                <div class="clear">
                                                </div>
                                            </div>
                                            <div class="row_curved" id="div11" runat="server">
                                                <label for="<%=txtPaymentModeDetail.ClientID%>" class="mand_red">
                                                    <asp:Label runat="server" Text="Payment Details" ID="Label12" /></label>
                                                <div class="field">
                                                    <span class="indicator">
                                                        <asp:TextBox ID="txtPaymentModeDetail" Width="240px" MaxLength="500" TextMode="MultiLine"
                                                            Rows="5" Columns="40" runat="server" />
                                                        <asp:RequiredFieldValidator ID="rfvPaymentModeDetail" ValidationGroup="StudentFeePaymentTrans"
                                                            ControlToValidate="txtPaymentModeDetail" runat="server" CssClass="validationErrorControl"
                                                            Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </span>
                                                </div>
                                                <div class="clear">
                                                </div>
                                            </div>
                                            <div class="row_curved" style="background-color: #efefef;" id="div5" runat="server">
                                                <label>
                                                    &nbsp;</label>
                                                <div class="field" style="width: 750px;">
                                                    <span class="indicator">
                                                        <asp:Button ID="btnSFPTSubmit" CssClass="button_normal_submit" Text="Save" ValidationGroup="StudentFeePaymentTrans"
                                                            OnClientClick="SubmitOnClientClick(this, 'StudentFeePaymentTrans');" runat="server"
                                                            OnClick="btnSFPTSubmit_Click" /></span> &nbsp;&nbsp;<asp:Button runat="server" ID="btnSFPTNew"
                                                                Text="New" OnClick="btnSFPTAddNew_Click" CssClass="button_normal_submit" />
                                                    &nbsp;&nbsp;&nbsp;&nbsp;</div>
                                                <div class="clear">
                                                </div>
                                            </div>
                                            <div class="row_curved" id="div6" runat="server">
                                                <label>
                                                    &nbsp;</label>
                                                <div class="field">
                                                    <asp:Label ID="lblSFPTMessage" Font-Bold="true" ForeColor="Red" runat="server"></asp:Label>
                                                </div>
                                                <div class="clear">
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                        </AjaxToolKit:TabPanel>
                    </AjaxToolKit:TabContainer>
                </fieldset>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        //<![CDATA[
        SetSumitNormalButtonAttribute(document.getElementById('<%=btnSFPTSubmit.ClientID%>'));
        //]]>
    </script>

</asp:Content>
